<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 御宅男 <530765310@qq.com>
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 登录验证
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class Staff extends Validate
{

    //定义验证规则
    protected $rule = [
        'username|真实姓名' => 'unique:staff|require',
        'password|密码'  => 'require|length:3,20|confirm',
        'password1|密码'  => 'require|length:3,20',
        'phone|手机号'     => 'require|unique:staff',
        'code|激活码'     => 'require',
        'team_id|团队'     => 'require',
    ];


    //定义验证场景
    protected $scene = [
        'insert' => ['phone', 'password', 'username'],
        'register' => ['phone', 'password1', 'username','code','team_id'],
        'update' => ['phone', 'username'],
    ];


}
